package com.scott.ch030.find.ch02;

import com.scott.utils.ZooKeeperConnectionUtil;
import org.apache.curator.framework.CuratorFramework;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.util.List;

public class GetAllNodeData {


    private CuratorFramework connection;

    @Before
    public void init() {
        connection = ZooKeeperConnectionUtil.getConnectionBeginWithNamespace();
        System.out.println(connection);
    }


    @Test
    public void test() throws Exception {
        List<String> path = connection.getChildren().forPath("/");
        System.out.println(path);
    }

    @After
    public void closeConnection (){
        if(null != connection){
            connection.close();
        }
    }
}
